<template>
	<view>
		<view class="index_bg">
			<swiper circular class="cdrttxewertt" :indicator-dots="true" indicator-color="#A1B889"  indicator-active-color="#FFC452" :autoplay="true" :interval="6000" :duration="1000">
				<swiper-item @click="goUrl('/pages/index/building?id='+item.id);cacheName(item.name)" v-for="(item,idx) in list" class="cz_w pr">
					<view class="cen cz_a">
						<image :src="'https://www.waibizi.com/'+item.fieldImgAddress" class="dfrrtxe " mode="aspectFill"></image>
					</view>
					<view class="cen crrtyser cf fz30">
						{{item.name}}
					</view>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>
<script>
	import store from '../../store/index.js'
	export default {
		data() {
			return {
				list:[]
			}
		},
		components: {

		},
		methods: {
            async fieldTypeAll(data) {
              let that = this;
              let res = await this.$api.fieldTypeAll(data);
        	  console.log('res',res)
              if(res.code==200){
                  that.list = res.data;
              }
              // this.$store.commit("setUserInfo", res);
            },
			goUrl(url) {
			  uni.navigateTo({
			    url: url,
			  });
			},
			cacheName(name){
				// localStorage.choosenBuilding = name;
				this.$store.commit("choosenBuilding", name);
			}
		},
		mounted() {
            this.fieldTypeAll()
		}
	}
</script>
<style scoped>
	.index_bg{
		background: linear-gradient(to bottom,#04133C, #4ABDCE);
		position: fixed;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		/* #ifdef H5 */
		padding-bottom: 100upx;
		/* #endif */

	}
	.cdrttxewertt{
		width: 100%;
		height: 100%;
	}
	.dfrrtxe{
		width: 560upx;
		height: 560upx;
	}
	.crrtyser{
		position: absolute;
		left: 0;
		bottom: 60upx;
		width: 100%;
	}
</style>
